home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of Down Under Games
/
The Best of Down Under Games.iso
/
3dfx Screen Savers
/
Chrome
/
NEW.C
< prev
next >
Wrap
C/C++ Source or Header
|
1997-05-30
|
2KB
|
112 lines
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
int facepoly,facevert;
int _3DXFORM=1; /*XX*/
#define MAXVERTEX 750
#define MAXFACE 1400
#define rad 0.01745329
#define MAX 1300 /*XX*/
#define START_SCANLINE 0 /*XX*/
#define END_SCANLINE 200 /*XX*/
#define X 0
#define Y 1
#define Z 2
#define LEFT_ENTRY 0
#define RITE_ENTRY 4
#define unitScale 127.0 /*XX*/
#define pixelScale 191.0 /*XX*/
#define arccos_size 256
#define VERTEXfile "vertex.dat"
#define FACETfile "facet.dat"
#define VNORMfile "VNORM.DAT"
#define PALfile "MOTION.PAL"
#define NBINS 400
#define BINSIZE 64
#define BINSIZELOG2 6
#define BLUR_LEVEL 1
#define MATRIX3D_RESOLUTION 10
short int VERTEX,FACE; /*XX*/
short int fobject[MAXVERTEX][3];
short int pt[MAXVERTEX][4],facet[MAXFACE][3],current_bin;
void loadobject()
{
int i;
FILE *f;
for (i=0;i<MAXVERTEX;i++)
fobject[i][0] = 9999;
for (i=0;i<MAXFACE;i++)
facet[i][0] = 9999;
f=fopen(VERTEXfile,"rb");
printf("fopen = %d\n",f);
fseek(f,-2L,SEEK_END);
fread(&VERTEX,1,2,f); /*XX*/
printf("no vertex = %d\n",VERTEX);
if(VERTEX>MAXVERTEX) { VERTEX=MAXVERTEX; }
fseek(f,0,SEEK_SET);
fread(fobject,1,VERTEX*3*2,f);
fclose(f);
f=fopen(FACETfile,"rb");
printf("Factetfile = %d\n",FACETfile);
fseek(f,-2L,SEEK_END);
fread(&FACE,1,2,f); /*XX*/
printf("Facets = %d\n",FACE);
if(FACE>MAXFACE) { FACE=MAXFACE; }
fseek(f,0,SEEK_SET);
fread(facet,1,FACE*3*2,f);
fclose(f);
printf("\n%d vertices loaded.\n%d facets loaded\n",VERTEX,FACE);
for (i=0;i<MAXVERTEX && fobject [i][0] != 9999;i++)
{
/*printf("vertex %d %d %d %d\n",i,
fobject[i][0],
fobject[i][1],
fobject[i][2]);*/
facevert = i+1;
}
for (i=0;i<MAXFACE && facet[i][0] != 9999;i++)
{
/*printf("facet %d %d %d %d\n",i,
facet[i][0], facet[i][1], facet[i][2]);*/
facepoly = i+1;
}
printf("max face %d max vert %d \n",facepoly, facevert);
}
/*
main ()
{
int i;
for (i=0;i<MAXVERTEX;i++)
fobject[i][0] = 9999;
for (i=0;i<MAXFACE;i++)
facet[i][0] = 9999;
loadfobject();
exit (0);
}
*/